//
//  CompanyOfJobCell.m
//  Btpin
//
//  Created by Vic on 2019/3/18.
//  Copyright © 2019 Vic. All rights reserved.
//

#import "CompanyOfJobCell.h"

@interface CompanyOfJobCell ()
{
    UILabel *jobLbl;
    UILabel *baseInfoLbl;
    UILabel *wageLbl;
    UILabel *timeLbl;
}
@end

@implementation CompanyOfJobCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initUI];
    }
    return self;
}
- (void)initUI {
    self.backgroundColor = COLOR_OF_CLEAR;
    self.contentView.backgroundColor = COLOR_OF_CLEAR;
    
    UIView *bgView = [UIToolsControl initViewWithFrame:CGRectMake(ScalePS(10), ScalePS(10), WIDTH-ScalePS(20), ScalePS(75)) backgroundColor:COLOR_OF_WHITE];
    bgView.layer.cornerRadius = ScalePS(8);
    bgView.layer.masksToBounds = YES;
    [self.contentView addSubview:bgView];
    
    jobLbl = [UIToolsControl initLabelWithFrame:CGRectMake(ScalePS(10), 15*Scale, 300, 26*Scale) text:nil textColor:THEMECOLOR_OF_TEXT_333333 font:Font_17];
    jobLbl.font = FontBold(Font_17);
    [bgView addSubview:jobLbl];
    
    baseInfoLbl = [UIToolsControl initLabelWithFrame:CGRectMake(StartX(jobLbl), EndY(jobLbl), ViewWidth(jobLbl), 25*Scale) text:nil textColor:THEMECOLOR_OF_TEXT_666666 font:Font_13];
    [bgView addSubview:baseInfoLbl];
    
    wageLbl = [UIToolsControl initLabelWithFrame:CGRectMake(WIDTH-200*Scale, 17*Scale, 185*Scale, 17*Scale) text:nil textColor:THEMECOLOR_OF_RED font:Font_15];
    wageLbl.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:wageLbl];
    
    timeLbl = [UIToolsControl initLabelWithFrame:CGRectMake(StartX(wageLbl), EndY(wageLbl)+12*Scale, ViewWidth(wageLbl), ViewHeight(wageLbl)) text:nil textColor:THEMECOLOR_OF_TEXT_cccccc font:Font_12];
    timeLbl.textAlignment = NSTextAlignmentRight;
    [self.contentView addSubview:timeLbl];
    timeLbl.hidden = YES;
}
- (void)reloadDataModel:(CompanyJobModel *)model {
    jobLbl.text = model.title;
    baseInfoLbl.text = [NSString stringWithFormat:@"%@ %@ %@", model.district_cn, model.experience_cn, model.education_cn];
    wageLbl.text = model.wage_cn;
    timeLbl.text = model.update_timeMMDD;
}

- (void)awakeFromNib {
    [super awakeFromNib];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
